home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / dev / mui / bcc.lha / BCC / Examples / JoyTest / EJG.bc < prev    next >
Encoding:
Text File  |  1997-06-10  |  1.1 KB  |  63 lines

  1. #include <proto/graphics.h>
  2.  
  3. #include "EJG.bh"
  4.  
  5. noearlydata cleardata Method EJG::EJG() :
  6.         MUIA_Background, MUII_BACKGROUND,
  7.         MUIA_Frame, MUIV_Frame_ReadList
  8. {
  9.  
  10. }
  11.  
  12. nodata super Method EJG::MUIM_AskMinMax()
  13. {
  14.     msg->MinMaxInfo->MinWidth  += 50;
  15.     msg->MinMaxInfo->DefWidth  += 120;
  16.     msg->MinMaxInfo->MaxWidth  += MBQ_MUI_MAXMAX;
  17.  
  18.     msg->MinMaxInfo->MinHeight += 6;
  19.     msg->MinMaxInfo->DefHeight += 6;
  20.     msg->MinMaxInfo->MaxHeight += 6;
  21.  
  22. }
  23.  
  24. super Method EJG::MUIM_Draw()
  25. {
  26.  
  27.     if ( msg->flags & MADF_DRAWUPDATE ) {
  28.  
  29.         SetBPen( _rp( obj ), 0 );
  30.         ScrollRaster( _rp( obj ), 1, 0, _mleft( obj )+1, _mtop( obj ), _mright( obj ), _mbottom( obj ) );
  31.         if( hit ) {
  32.             SetAPen( _rp( obj ), 2 );
  33.             WritePixel( _rp( obj ), _mright( obj ), _mtop( obj ) + 1 );
  34.         }
  35.         else {
  36.             SetAPen( _rp( obj ), 1 );
  37.             WritePixel( _rp( obj ), _mright( obj ), _mtop( obj ) + 4 );
  38.         }
  39.  
  40.         hit = 0;
  41.  
  42.     }
  43.     
  44. }
  45.  
  46. super Method EJG::MUIM_Show()
  47. {
  48.     render = 1;
  49. }
  50.  
  51. super Method EJG::MUIM_Hide()
  52. {
  53.     render = 0;
  54. }
  55.  
  56. Method EJG::Anim( unsigned long sig )
  57. {
  58.     if( render ) {
  59.         if( sig ) hit = 1;
  60.         MUI_Redraw( obj, MADF_DRAWUPDATE );
  61.     }
  62. }
  63.